package cn.learn.athena.api.service;

import cn.learn.athena.model.User;
import cn.learn.athena.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author zlj
 * @Date 2018/10/30
 * @des
 */

@FeignClient(name="platform-user")
public interface UserServiceClient {

    /**
    * 功能:
    *  更具用户名密码获取用户
    * @param loginName
    * @param password
    * @return
    * @date 2018/10/30
    */
    @RequestMapping(value = "/login" ,method = RequestMethod.GET)
    User login(@RequestParam("loginName") String loginName, @RequestParam("password") String password);

    /**
    * 功能:
    * 添加用户
    * @param user
    * @return  boolean
    * @date 2018/11/1
    */
    @RequestMapping(value = "/addUser" )
    Result addUser(User user);

    /**
    * 功能:
    *  更具用户名获取用户
    * @param userName
    * @return
    * @date 2019/1/10
    */
    @RequestMapping(value = "/findUserByName",method = RequestMethod.GET)
    User findUserByName(@RequestParam("userName") String userName);
}
